public class Exec02 {
    public int[] twoSum(int[] price, int target) {
        int left = 0, right = price.length - 1;
        int[] ret =new int[2];
        while(left < right){
            if(price[left] + price[right]  == target){
                ret[0] = price[left];ret[1] = price[right];
                break;
            }else if(price[left] + price[right]  > target){
                right--;
            }else{
                left++;
            }
        }
        return ret;
    }
}
